import request from '@/utils/request'

export function list(params) {
  return request({
    url: '/active',
    method: 'get',
    params: params
  })
}

export function put(id, params) {
  return request({
    url: `/active/${id}`,
    method: 'put',
    params
  })
}

export function edit(id) {
  return request({
    url: `/active/${id}/edit`,
    method: 'get'
  })
}

export function save(data) {
  return request({
    url: `/active`,
    method: 'post',
    data
  })
}

export function istop(data) {
  return request({
    url: `/active/is_top`,
    method: 'post',
    data
  })
}

export function deleted(id) {
  return request({
    url: `/active/${id}`,
    method: 'delete'
  })
}

export function read(id) {
  return request({
    url: `/active/${id}`,
    method: 'get'
  })
}
